package today.rocky.boot.eureka.gateway.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Rocky
 * @version 1.0
 * @date 2020/3/7 10:23
 */
@Configuration
public class RoutingConfig {
    @Bean
    public RouteLocator getCustomRouter(RouteLocatorBuilder builder){
        RouteLocatorBuilder.Builder routes = builder.routes();
        routes.route("search_reflect",r->r.path("/guo").uri("https://www.bilibili.com/video/av93824064?p=70")).build();
        return routes.build();
    }

}
